A hard disk is a main storage medium of a computer. The hard disks may be divided into solid-state drives (SSDs), hard disk drives (HDDs), hybrid hard drives (HHDs), etc. A manufactured hard disk may generally have a plurality of bad areas. These areas are referred to as “primary defective areas.” For example, the HDD may have a plurality of primary defective sectors. A HDD manufacturer makes tests to map these primary defective sectors to backup sectors by using firmware. The backup sectors are invisible outside the HDD. Therefore, when an external input output (I/O) instruction is addressed to a defective sector, the HDD actually maps the instruction to the backup sector. Additionally, bad sectors will also be generated during use of the HDD. This kind of bad sectors are referred to as “grown defective sectors.” The “grown defective sectors” may be mapped to these backup sectors by using HDD firmware. When the backup sectors are used up, the HDD needs to be replaced. Similar occasions also exist in other types of storage mediums.